/*  JInternalFrameSelecionarTime.java
 *  Copyright (C) 2009  Tiago Silva Loureiro
 *  This File is part of Bier Manager.
 *  Bier Manager a is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
/*  JInternalFrameSelecionarTime.java - Bier Manager
 *
 *  Tela para selecionar um time e finalizar a criação de novo jogo.
 * 
 *  @author Tiago Silva Loureiro
 * *
 */
package biermanager.interfaceGrafica;

import biermanager.nucleo.ConstantesDeCaminho;
import biermanager.nucleo.Conta;
import biermanager.nucleo.DadosContas;
import biermanager.nucleo.DadosTimes;
import biermanager.nucleo.Time;
import biermanager.componentes.Eventos;
import biermanager.componentes.PintorDeBackground;
import biermanager.componentes.PintorDeForeground;
import com.db4o.ObjectSet;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
import java.util.ArrayList;
import java.util.Timer;
import java.util.TimerTask;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JTable;
import javax.swing.border.Border;
import javax.swing.border.TitledBorder;
import javax.swing.event.MouseInputAdapter;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellRenderer;
import org.jdesktop.swingx.JXLabel;
import org.jdesktop.swingx.JXTable;

/**
 *
 * @author tiagoloureiro
 */
public class JInternalFrameSelecionarTime extends javax.swing.JInternalFrame {

    private float alpha;
    private PintorDeBackground pintor;
    private Conta conta;
    private DadosTimes dadosTimes;
    private ObjectSet times;
    private Time[] timeTemporario;
    private Object[] img;
    private DefaultTableModel tabelaEscolhaTimes;
    private int linha;
    private int coluna;
    private int indiceDoTime;

    /** Creates new form JInternalFrameSelecionarTime
     * @param contaTemporaria
     */
    private void setAlpha() {
        jxPainelEstruturado.setAlpha(alpha);
        jxPainelTabela.setAlpha(alpha);
    }

    public JInternalFrameSelecionarTime(Conta contaTemporaria) {
        initComponents();
        iniciarDisplay();
        iniciarBackgrounds();
        iniciarForegrounds();
        iniciarTabela(contaTemporaria);
    }

    private void iniciarDisplay() {
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        setLocation((int) ((screenSize.getWidth() - this.getWidth()) / 2), 10);
        ((javax.swing.plaf.basic.BasicInternalFrameUI) this.getUI()).setNorthPane(null);
    }

    private void iniciarBackgrounds() {
        jxtableTabelaTransparente.setSelectionBackground(new Color(255, 255, 255, 0));
        jxtableTabelaTransparente.setSelectionForeground(new Color(255, 255, 255, 0));
        jscrollpaneTransparente.setBackground(new Color(255, 255, 255, 0));
        jxtableTabelaTransparente.setBorder(null);
        jxtableTabelaTransparente.setBackground(new Color(255, 255, 255, 0));
        jxtableTabelaTransparente.setOpaque(true);
        jscrollpaneTransparente.setOpaque(true);

        pintor = new PintorDeBackground();
        jxPainelEstruturado.setBackgroundPainter(pintor.pintarDegradePreto(jxPainelEstruturado));
        jxlabelBotaoContinuar.setBackgroundPainter(pintor.pintarBotaoSemFocoCapsulaPreto());
        jxlabelBotaoFechar.setBackgroundPainter(pintor.pintarCinzaTransparente(jxlabelBotaoFechar));
    }

    private void iniciarForegrounds() {
        jxlabelBotaoContinuar.setForeground(PintorDeForeground.corBotao());
        jxlabelBotaoFechar.setForeground(PintorDeForeground.corFechar());
    }

    private void iniciarTabela(Conta contaTemporaria) {

        indiceDoTime = -1;
        conta = contaTemporaria;
        linha = 0;
        coluna = 0;
        tabelaEscolhaTimes = (DefaultTableModel) jxtableTabelaTransparente.getModel();
        RenderizadorDeImagens render = new RenderizadorDeImagens();
        jxtableTabelaTransparente.setDefaultRenderer(Object.class, render);
        jxtableTabelaTransparente.setPreferredScrollableViewportSize(jxtableTabelaTransparente.getPreferredSize());
        jxtableTabelaTransparente.addMouseMotionListener(new CellListener());
        jxtableTabelaTransparente.addMouseListener(new ClickListener());
        dadosTimes = new DadosTimes(ConstantesDeCaminho.arquivoDeTimes);
        times = dadosTimes.getAllTimes();
        timeTemporario = new Time[jxtableTabelaTransparente.getColumnCount()];
        img = new ImageIcon[jxtableTabelaTransparente.getColumnCount()];
        while (times.hasNext()) {
            for (int i = 0; i < jxtableTabelaTransparente.getColumnCount(); i++) {
                img[i] = null;
                timeTemporario[i] = null;
                if (times.hasNext()) {
                    timeTemporario[i] = (Time) times.next();
                }
            }
            tabelaEscolhaTimes.addRow(timeTemporario);
        }
    }

    private class CellListener extends MouseMotionAdapter {

        @Override
        public void mouseMoved(MouseEvent e) {
            JXTable tb = (JXTable) e.getSource();
            linha = tb.rowAtPoint(e.getPoint());
            coluna = tb.columnAtPoint(e.getPoint());
            tb.repaint();
        }
    }

    private class ClickListener extends MouseInputAdapter {

        @Override
        public void mouseReleased(MouseEvent e) {
            JXTable tb = (JXTable) e.getSource();
            linha = tb.rowAtPoint(e.getPoint());
            coluna = tb.columnAtPoint(e.getPoint());
            indiceDoTime = tb.getColumnCount() * linha + coluna;
            if (linha >= 0 && coluna >= 0) {
                if (indiceDoTime < times.size()) {
                    Time temp = (Time) times.get(indiceDoTime);
                }
            }
        }
    }

    public class RenderizadorDeImagens extends JXLabel implements TableCellRenderer {

        public Component getTableCellRendererComponent(JTable table, Object objetoTime, boolean isSelected, boolean hasFocus, int row, int column) {
            this.setForeground(new Color(240, 240, 240));
            if (objetoTime != null) {
                Time time = (Time) objetoTime;
                String nomeDoTime = time.getNomeCompleto();
                Font fontes = new Font("Tahoma", Font.BOLD, 10);
                Font fonteSelecionada = new Font("Tahoma", Font.BOLD, 11);
                Font fonteEscolhida = new Font("Tahoma", Font.BOLD, 12);
                Color corDeFundo = new Color(240, 95, 95);
                Border bordaSelecionadaFocada = BorderFactory.createTitledBorder(null, nomeDoTime, TitledBorder.CENTER, TitledBorder.BELOW_BOTTOM, fonteSelecionada, Color.WHITE);
                Border bordaSelecionada = BorderFactory.createTitledBorder(null, nomeDoTime, TitledBorder.CENTER, TitledBorder.BELOW_BOTTOM, fonteEscolhida, new Color(255, 255, 255));
                Border bordaSelecionar = BorderFactory.createTitledBorder(null, nomeDoTime, TitledBorder.CENTER, TitledBorder.ABOVE_TOP, fontes, Color.WHITE);
                if (isSelected && hasFocus) {
                    if (row == linha && column == coluna) {
                        this.setBorder(bordaSelecionadaFocada);
                        this.setBackground(corDeFundo);
                        this.setOpaque(true);
                        this.setBackgroundPainter(pintor.pintarPainelTransparente());
                    } else {
                        this.setBorder(bordaSelecionada);
                        this.setBackground(corDeFundo);
                        this.setOpaque(true);
                        this.setBackgroundPainter(pintor.pintarPainelSelecionar());
                    }
                } else {
                    if (row == linha && column == coluna) {
                        this.setBorder(bordaSelecionar);
                        this.setBackgroundPainter(pintor.pintarPainelSelecionado());
                        this.setOpaque(false);
                    } else {
                        this.setBorder(BorderFactory.createEmptyBorder());
                        this.setBackgroundPainter(pintor.pintarPainelTransparente());
                        this.setOpaque(false);
                    }

                }
                this.setIcon(new ImageIcon((time.getImagemSerializada().getImagem())));
                this.setVerticalTextPosition(BOTTOM);
                this.setHorizontalTextPosition(CENTER);
                this.setHorizontalAlignment(CENTER);
                this.setVerticalAlignment(CENTER);
                this.setOpaque(false);
            } else {
                this.setIcon(null);
                this.setBorder(null);
                this.setText(null);
                this.setOpaque(false);
                this.setBackgroundPainter(pintor.pintarPainelTransparente());
            }
            return this;
        }
    }

    /**
     * Gerado automaticamente pelo matisse( Editor visual do NetBeans ).
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jxPainelInvisivel = new org.jdesktop.swingx.JXPanel();
        jxPainelEstruturado = new org.jdesktop.swingx.JXPanel();
        jlabelSelecionarTime = new javax.swing.JLabel();
        jlabelImagemTopo = new javax.swing.JLabel();
        jxPainelTabela = new org.jdesktop.swingx.JXPanel();
        jscrollpaneTransparente = new javax.swing.JScrollPane();
        jxtableTabelaTransparente = new org.jdesktop.swingx.JXTable();
        jxlabelBotaoContinuar = new org.jdesktop.swingx.JXLabel();
        jxlabelBotaoFechar = new org.jdesktop.swingx.JXLabel();

        setBackground(new java.awt.Color(0, 0, 0));
        setBorder(javax.swing.BorderFactory.createCompoundBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)), javax.swing.BorderFactory.createLineBorder(new java.awt.Color(102, 102, 102))));
        setFocusCycleRoot(false);
        setFocusable(false);
        setPreferredSize(new java.awt.Dimension(642, 550));
        setRequestFocusEnabled(false);
        setVerifyInputWhenFocusTarget(false);
        addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentShown(java.awt.event.ComponentEvent evt) {
                formComponentShown(evt);
            }
        });

        jxPainelInvisivel.setBackground(new java.awt.Color(255, 255, 255));
        jxPainelInvisivel.setOpaque(false);
        jxPainelInvisivel.setDoubleBuffered(false);
        jxPainelInvisivel.setEnabled(false);
        jxPainelInvisivel.setFocusable(false);
        jxPainelInvisivel.setRequestFocusEnabled(false);
        jxPainelInvisivel.setVerifyInputWhenFocusTarget(false);

        jxPainelEstruturado.setAlpha(0.f);
        jxPainelEstruturado.setBackground(new java.awt.Color(255, 255, 255));
        jxPainelEstruturado.setInheritAlpha(false);
        jxPainelEstruturado.setOpaque(false);
        jxPainelEstruturado.setDoubleBuffered(false);
        jxPainelEstruturado.setPreferredSize(new java.awt.Dimension(1000, 653));
        jxPainelEstruturado.setRequestFocusEnabled(false);

        jlabelSelecionarTime.setFont(new java.awt.Font("Tahoma", 1, 18));
        jlabelSelecionarTime.setForeground(new java.awt.Color(255, 255, 255));
        jlabelSelecionarTime.setText("Escolha a sua Equipe!!!");

        jlabelImagemTopo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/biermanager/imagens/novojogo.png"))); // NOI18N

        jxPainelTabela.setAlpha(0.f);
        jxPainelTabela.setBackground(new java.awt.Color(153, 255, 153));
        jxPainelTabela.setInheritAlpha(false);
        jxPainelTabela.setOpaque(false);
        jxPainelTabela.setDoubleBuffered(false);
        jxPainelTabela.setPreferredSize(new java.awt.Dimension(1000, 481));
        jxPainelTabela.setRequestFocusEnabled(false);

        jscrollpaneTransparente.setBackground(new java.awt.Color(0, 0, 0));
        jscrollpaneTransparente.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
        jscrollpaneTransparente.setOpaque(false);
        jscrollpaneTransparente.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
        jscrollpaneTransparente.setFocusable(false);
        jscrollpaneTransparente.setRequestFocusEnabled(false);
        jscrollpaneTransparente.setVerifyInputWhenFocusTarget(false);
        jscrollpaneTransparente.setWheelScrollingEnabled(false);

        jxtableTabelaTransparente.setBackground(new java.awt.Color(0, 0, 0));
        jxtableTabelaTransparente.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "", "", "", ""
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jxtableTabelaTransparente.setAlignmentX(0.0F);
        jxtableTabelaTransparente.setAlignmentY(0.0F);
        jxtableTabelaTransparente.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
        jxtableTabelaTransparente.setAutoStartEditOnKeyStroke(false);
        jxtableTabelaTransparente.setAutoscrolls(false);
        jxtableTabelaTransparente.setEditable(false);
        jxtableTabelaTransparente.setIntercellSpacing(new java.awt.Dimension(0, 0));
        jxtableTabelaTransparente.setOpaque(false);
        jxtableTabelaTransparente.setPreferredSize(new java.awt.Dimension(600, 600));
        jxtableTabelaTransparente.setRolloverEnabled(false);
        jxtableTabelaTransparente.setRowHeight(100);
        jxtableTabelaTransparente.setShowHorizontalLines(false);
        jxtableTabelaTransparente.setShowVerticalLines(false);
        jxtableTabelaTransparente.setSortable(false);
        jxtableTabelaTransparente.setTableHeader(null);
        jscrollpaneTransparente.setViewportView(jxtableTabelaTransparente);

        jxlabelBotaoContinuar.setForeground(new java.awt.Color(255, 255, 255));
        jxlabelBotaoContinuar.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jxlabelBotaoContinuar.setText("Continuar!");
        jxlabelBotaoContinuar.setFont(new java.awt.Font("Tahoma", 1, 12));
        jxlabelBotaoContinuar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jxlabelBotaoContinuarMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jxlabelBotaoContinuarMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jxlabelBotaoContinuarMouseExited(evt);
            }
        });

        javax.swing.GroupLayout jxPainelTabelaLayout = new javax.swing.GroupLayout(jxPainelTabela);
        jxPainelTabela.setLayout(jxPainelTabelaLayout);
        jxPainelTabelaLayout.setHorizontalGroup(
            jxPainelTabelaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jxPainelTabelaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jscrollpaneTransparente, javax.swing.GroupLayout.PREFERRED_SIZE, 602, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jxPainelTabelaLayout.createSequentialGroup()
                .addContainerGap(468, Short.MAX_VALUE)
                .addComponent(jxlabelBotaoContinuar, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jxPainelTabelaLayout.setVerticalGroup(
            jxPainelTabelaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jxPainelTabelaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jscrollpaneTransparente, javax.swing.GroupLayout.PREFERRED_SIZE, 411, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jxlabelBotaoContinuar, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jxlabelBotaoFechar.setForeground(new java.awt.Color(255, 255, 255));
        jxlabelBotaoFechar.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jxlabelBotaoFechar.setText("x");
        jxlabelBotaoFechar.setFont(new java.awt.Font("Tahoma", 1, 14));
        jxlabelBotaoFechar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jxlabelBotaoFechar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jxlabelBotaoFecharMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jxlabelBotaoFecharMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jxlabelBotaoFecharMouseExited(evt);
            }
        });

        javax.swing.GroupLayout jxPainelEstruturadoLayout = new javax.swing.GroupLayout(jxPainelEstruturado);
        jxPainelEstruturado.setLayout(jxPainelEstruturadoLayout);
        jxPainelEstruturadoLayout.setHorizontalGroup(
            jxPainelEstruturadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jxPainelEstruturadoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jxPainelEstruturadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jxPainelTabela, javax.swing.GroupLayout.DEFAULT_SIZE, 622, Short.MAX_VALUE)
                    .addGroup(jxPainelEstruturadoLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(jlabelSelecionarTime))
                    .addGroup(jxPainelEstruturadoLayout.createSequentialGroup()
                        .addComponent(jlabelImagemTopo)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 365, Short.MAX_VALUE)
                        .addComponent(jxlabelBotaoFechar, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jxPainelEstruturadoLayout.setVerticalGroup(
            jxPainelEstruturadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jxPainelEstruturadoLayout.createSequentialGroup()
                .addGroup(jxPainelEstruturadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jxPainelEstruturadoLayout.createSequentialGroup()
                        .addComponent(jlabelImagemTopo)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jlabelSelecionarTime))
                    .addComponent(jxlabelBotaoFechar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jxPainelTabela, javax.swing.GroupLayout.PREFERRED_SIZE, 460, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(55, 55, 55))
        );

        javax.swing.GroupLayout jxPainelInvisivelLayout = new javax.swing.GroupLayout(jxPainelInvisivel);
        jxPainelInvisivel.setLayout(jxPainelInvisivelLayout);
        jxPainelInvisivelLayout.setHorizontalGroup(
            jxPainelInvisivelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jxPainelEstruturado, javax.swing.GroupLayout.PREFERRED_SIZE, 642, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        jxPainelInvisivelLayout.setVerticalGroup(
            jxPainelInvisivelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jxPainelEstruturado, javax.swing.GroupLayout.PREFERRED_SIZE, 542, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jxPainelInvisivel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jxPainelInvisivel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void formComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentShown
        jxPainelEstruturado.setAlpha(0.f);
        alpha = 0.f;
        final Timer tempo = new Timer();              //Temporizador
        TimerTask tarefa = new TimerTask() {     //Objeto tarefa a ser realizada

            public void run() {                 //Metodo run que implementa a tarefa
                if ((alpha + 0.05) <= 1.0f) {
                    alpha = alpha + 0.05f;
                } else {
                    tempo.cancel();
                }
                setAlpha();
            }
        };
        tempo.schedule(tarefa, 50, 5);
    }//GEN-LAST:event_formComponentShown

    private void jxlabelBotaoContinuarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jxlabelBotaoContinuarMouseClicked
      /*  ArrayList<Time> arrayTimes = new ArrayList<Time>();
        for (int i = 0; i < times.size(); i++) {
            arrayTimes.add((Time) times.get(i));
        }
        conta.setTimes(arrayTimes);
        conta.setIndiceTimeAtual(indiceDoTime);
        conta.setEstatisticas(null);
        conta.setPontosDeExperiencia(0);
        conta.setTemporada(null);
        DadosContas dadosContas = new DadosContas(ConstantesDeCaminho.arquivoDeContas);
        dadosContas.createConta(conta);
        dadosContas.closeDatabase();
        dadosTimes.closeDatabase();*/
        firePropertyChange("Continuar", null, conta);
}//GEN-LAST:event_jxlabelBotaoContinuarMouseClicked

    private void jxlabelBotaoContinuarMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jxlabelBotaoContinuarMouseEntered
       Eventos.mouseEntraBotao(evt);
}//GEN-LAST:event_jxlabelBotaoContinuarMouseEntered

    private void jxlabelBotaoContinuarMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jxlabelBotaoContinuarMouseExited
       Eventos.mouseSaiBotao(evt);
}//GEN-LAST:event_jxlabelBotaoContinuarMouseExited

    private void jxlabelBotaoFecharMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jxlabelBotaoFecharMouseClicked
        firePropertyChange("Fechar", null, null);
}//GEN-LAST:event_jxlabelBotaoFecharMouseClicked

    private void jxlabelBotaoFecharMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jxlabelBotaoFecharMouseEntered
       Eventos.mouseEntraFechar(evt);
}//GEN-LAST:event_jxlabelBotaoFecharMouseEntered

    private void jxlabelBotaoFecharMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jxlabelBotaoFecharMouseExited
       Eventos.mouseSaiFechar(evt);
}//GEN-LAST:event_jxlabelBotaoFecharMouseExited
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jlabelImagemTopo;
    private javax.swing.JLabel jlabelSelecionarTime;
    private javax.swing.JScrollPane jscrollpaneTransparente;
    private org.jdesktop.swingx.JXPanel jxPainelEstruturado;
    private org.jdesktop.swingx.JXPanel jxPainelInvisivel;
    private org.jdesktop.swingx.JXPanel jxPainelTabela;
    private org.jdesktop.swingx.JXLabel jxlabelBotaoContinuar;
    private org.jdesktop.swingx.JXLabel jxlabelBotaoFechar;
    private org.jdesktop.swingx.JXTable jxtableTabelaTransparente;
    // End of variables declaration//GEN-END:variables
}
